function getOptions(colorList, data) {
    let option = {
        visualMap: [{
            type: "continuous",
            min: 0,
            max: 100,
            itemWidth: 12,
            itemHeight: 56,
            text: ['高', '低'],
            // textGap:
            // color: ["#FF3C3C", "#FF926B", "#FDDD4A", "#FFF9EE"],
            color: colorList,
    
        }],
        tooltip: {
            show: true,
            trigger: 'item',
            backgroundColor: "rgba(31, 45, 61, .75)",
            borderColor: "rgba(31, 45, 61, .75)",
            textStyle: {
                color: "#fff"
            },
            padding: [5, 10],
            formatter: function(params) {
                console.log(params);
                let { data } = params
                if(!data) return;
                let detail = `<div style="width: 170px; height: 50px;font-size: 14px">
                    <h3 style="font-size: 14px; margin-bottom: 5px;">${params.name}</h3>
                    <div style="font-size: 12px;">${'患病率'}${data?.value || '-'}${data?.unit || '%'}</div>
                </div>`;
                return detail;
            }
    
        },
        geo: {
            show: true,
            map: "110000",
            label: {
                show: true,
                color: "#3A2E69",
            },
            itemStyle: {
                areaColor: colorList[colorList.length - 1],
                borderColor: colorList[0]
            }
        },
        series: [{
            type: "map",
            name: "背景地图",
            geoIndex: 0,
            data
            // data: [
            //     {
            //         name: "东城区",
            //         regionCode: "110100",
            //         value: "89"
            //     },
            //     {
            //         name: "西城区",
            //         regionCode: "110200",
            //         value: "60"
            //     },
            //     {
            //         name: "朝阳区",
            //         regionCode: "110300",
            //         value: "34"
            //     },
    
            // ]
        }]
    }
    return option;
}

export default getOptions;